<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
class Message extends Model
{
	//指定表名
	protected $table='message';
	//指定id
	protected $primaryKey ='id';
	//自动维护时间戳
	public $timestamps= true;

	public function photos(){
		return $this->hasMany('App\Photo','message_id','id');
	}
	//批量赋值
	//protected $fillable =['status','slogan','summary'];   
	public function getCafe(){
		return $this->hasOne('App\Cafe','id','cafe_id');
	}
}
